package ooday04;

public class InnerClassDemo {
    public static void main(String[] args) {
        Mama m = new Mama();
     //   Baby b = new Baby();
    }
}
class Mama{//外部类
    String name;
    void create(){//内部类
        Baby b = new Baby();//内部类对象通常在外部类中创建
    }
    class Baby{
        void show(){
            System.out.println(name);//简写
            System.out.println(Mama.this.name);//完整写法，Mama.this指外部类
           // System.out.println(this.name);//编译错误，this指当前Baby对象
        }
    }
}